package com.springboot.demo.io.socketmultiplex;

import java.util.Scanner;

/**
 * NIO客户端
 *
 * @author supu
 * @date 2019-12-03 16:10
 **/
public class NIOClient {

    private static NIOClientHandler nioClientHandler;

    public static void startClient(){
        nioClientHandler = new NIOClientHandler();
        new Thread(nioClientHandler).start();
    }


    public static void main(String[] args) {
        // 开启客户端
        NIOClient.startClient();

        // 发送消息
        while(nioClientHandler.sendMsg(new Scanner(System.in).nextLine()));
    }
}
